package com.yehui.springboot.event;

import org.springframework.boot.context.event.ApplicationContextInitializedEvent;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.context.event.ApplicationFailedEvent;
import org.springframework.boot.context.event.ApplicationPreparedEvent;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.boot.context.event.ApplicationStartingEvent;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.context.event.ContextStoppedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * @author 业徽
 * @date 2021/6/29
 */
@Component
public class EventDemo {

    @EventListener
    public void contextRefreshedEvent(ContextRefreshedEvent event) {
        System.out.println("ContextRefreshedEvent");
    }

    @EventListener
    public void contextStartedEvent(ContextStartedEvent event) {
        System.out.println("ContextStartedEvent");
    }

    @EventListener
    public void contextStoppedEvent(ContextStoppedEvent event) {
        System.out.println("ContextStoppedEvent");
    }

    @EventListener
    public void contextClosedEvent(ContextClosedEvent event) {
        System.out.println("ContextClosedEvent");
    }

    @EventListener
    public void applicationContextInitializedEvent(ApplicationContextInitializedEvent event) {
        System.out.println("ApplicationContextInitializedEvent");
    }

    @EventListener
    public void applicationEnvironmentPreparedEvent(ApplicationEnvironmentPreparedEvent event) {
        System.out.println("ApplicationEnvironmentPreparedEvent");
    }

    @EventListener
    public void applicationFailedEvent(ApplicationFailedEvent event) {
        System.out.println("ApplicationFailedEvent");
    }

    @EventListener
    public void applicationPreparedEvent(ApplicationPreparedEvent event) {
        System.out.println("ApplicationPreparedEvent");
    }

    @EventListener
    public void applicationReadyEvent(ApplicationReadyEvent event) {
        System.out.println("ApplicationReadyEvent");
    }

    @EventListener
    public void applicationStartedEvent(ApplicationStartedEvent event) {
        System.out.println("ApplicationStartedEvent");
    }

    @EventListener
    public void applicationStartingEvent(ApplicationStartingEvent event) {
        System.out.println("ApplicationStartingEvent");
    }

}
